<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-15
    	描述：企业库
    -->
	<div class="PressRelease">
		<div class="search-box">
			<div class="fl">
				<input @click="manually(0)" class="btn-boxs" type="button" value="人工录入" />
				<input class="btn-boxs" type="button" @click="$refs.inputFile.click()" value="数据导入" />
        <input type="file" ref="inputFile" accept=".xls,.xlsx" style="display: none" @click="inputData"/>

				<input class="btn-boxs" type="button" @click="exportEnterprise" value="数据导出" />
			</div>
			<div class="fr">
				<select class="search" id="searchName">
					<option value="name">企业名称</option>
          <option value="person">法人</option>
          <option value="address">地址</option>
          <option value="reserved">联系人</option>

				</select>
				<input class="search" type="text" v-model="searchValue" id="searchValue" />
				<input type="button" value="搜索" @click="getData" class="btn" />
			</div>
		</div>
		<div class="PressRelease-list">
			<table>
				<thead>
					<tr>
						<th class="table-text-th2">企业名称</th>
						<th class="table-text-th1">法人</th>
						<th class="table-text-th3">地址</th>
						<th class="table-text-th1">联系人</th>
						<th class="table-text-th1">联系电话</th>
						<th class="table-text-th3">操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for=" e in enterprise">
						<td :title="e.name"><span class="show-oneline-table">{{e.name}}</span></td>
						<td :title="e.person"><span class="show-oneline-table">{{e.person}}</span></td>
						<td :title="e.address"><span class="show-oneline-table">{{e.address}}</span></td>
						<td :title="e.reserved"><span class="show-oneline-table">{{e.reserved}}</span></td>

						<td :title="e.contact"><span class="show-oneline-table">{{e.contact}}</span></td>
						<td><input @click="manually(e.id)" type="button" value="修改" class="delete write" />
							<input @click="toView(e.id)" type="button" value="查看" class="delete write" /></td>
					</tr>

				</tbody>
			</table>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
			<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		</div>

		<!-- 人工录入-模态框-->
		<div v-show="ApplicationStatus" class="tenant-model">
			<div class="tenant-model-content Application">
				<header class="tenant-model-header">
					<h3 v-if="!isModify">人工录入</h3>
					<h3 v-if="isModify">修改</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box" id="enterpriseForm">
							<div class="form-line input-required">
								<label>企业姓名：</label>
								<div class="input-box">
									<input type="text" name="name" v-model="obj.name">
								</div>
							</div>
							<div class="form-line input-required">
								<label>地址：</label>
								<div class="input-box">
									<input type="text" name="address" v-model="obj.address">
								</div>
							</div>
							<div class="form-line ">
								<label>法人：</label>
								<div class="input-box">
									<input type="text" name="person" v-model="obj.person">
								</div>
							</div>
							<div class="form-line input-required">
								<label>注册资金：</label>
								<div class="input-box">
									<input type="text" name="money" v-model="obj.money">
								</div>
							</div>
							<div class="form-line input-required">
								<label>联系人：</label>
								<div class="input-box">
									<input type="text" name="reserved" v-model="obj.reserved">
								</div>
							</div>
							<div class="form-line input-required">
								<label>联系方式：</label>
								<div class="input-box">
									<input type="text" name="contact" v-model="obj.contact">
								</div>
							</div>
							<div class="form-line input-required finance-contact">
								<label class="form-line-label">财务联系人：</label>
								<div class="input-box ">
									<input type="text" name="financial" v-model="obj.financial">
								</div>
							</div>
							<div class="form-line input-required form-line-boxs">
								<label class="form-line-label">财务联系方式：</label>
								<div class="input-box ">
									<input type="text" name="financialPhone" v-model="obj.financialPhone">
								</div>
							</div>
							<input type="hidden" v-model="testAttachment" name="testAttachment" />
							<input type="hidden" v-model="imageAttachment" name="imageAttachment" />
							<input type="hidden" v-model="videoAttachment" name="videoAttachment" />
              <input type="reset" style="display: none"/>
						</form>
						<div class="tab-tit">
							<a href="javascript:;" @click="clickcurId(0)" :class="{'cur':curId===0}">文本</a>
							<a href="javascript:;" @click="clickcurId(1)" :class="{'cur':curId===1}">图像</a>
							<a href="javascript:;" @click="clickcurId(2)" :class="{'cur':curId===2}">音视频</a>


						</div>
						<!--表头-->

						<div class="tab-con">
							<div v-show="curId===0">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
										<th>删除</th>
									</tr>
									<tr v-for="f in FileUpload">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

										<td>
											<input type="button" value="删除" @click="del(f)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
							<div v-show="curId===1">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
										<th>删除</th>
									</tr>
									<tr v-for="f in FileUploadImg">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

										<td>
											<input type="button" value="删除" @click="del(f)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
							<div v-show="curId===2">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
										<th>删除</th>
									</tr>
									<tr v-for="f in FileUploadVideo">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

										<td>
											<input type="button" value="删除" @click="del(f)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
							<div v-show="curId == 0">
								<div>
									<button class="upload-img" @click="touchOffIdInput(1)">上传附件</button>
								<!--<a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">上传附件</a>-->
									<input type="file" multiple id="imageAttachment1" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf" @change="idFrontImg($event)" style="display: none;" />
								</div>
							</div>

							<div v-show="curId == 1">
								<div>
									<button class="upload-img" @click="touchImg(1)">上传附件</button>
								<!--<a class="Public-btn1 uploadbtn handIdFrontA " @click="touchImg(1)">上传附件</a>-->
									<input type="file" multiple id="touchImg" accept="image/*" @change="touchUploadImg($event)" style="display: none;" />
								</div>
							</div>

							<div v-show="curId == 2">
								<div>
									<button class="upload-img" @click="touchVideo(1)">上传附件</button>
								<!--<a class="Public-btn1 uploadbtn handIdFrontA " @click="touchVideo(1)">上传附件</a>-->
									<input type="file" multiple id="touchVideo" accept="video/*" @change="idFrontVideo($event)" style="display: none;" />
								</div>
							</div>
						</div>
						<!--数据-->

					</div>
				</div>
				<footer class="tenant-model-footer">
					<button class="determine" @click="subForm">确认</button>
				</footer>
			</div>
		</div>
		<!--查看-模态框-->
		<div v-show="Application" class="tenant-model">
			<div class="tenant-model-content ApplicationStatus">
				<header class="tenant-model-header">
					<h3>查看</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box">
							<div class="form-line ">
								<label>企业姓名：</label>
								<div class="input-box" :title="obj.name">
									{{obj.name}}
								</div>
							</div>
							<div class="form-line ">
								<label>地址：</label>
								<div class="input-box" :title="obj.address">
									{{obj.address}}
								</div>
							</div>
							<div class="form-line ">
								<label>法人：</label>
								<div class="input-box" :title="obj.person">
									{{obj.person}}
								</div>
							</div>
							<div class="form-line ">
								<label>注册资金：</label>
								<div class="input-box">
									{{obj.money}}
								</div>
							</div>
							<div class="form-line ">
								<label>联系人：</label>
								<div class="input-box" :title="obj.reserved">
									{{obj.reserved}}
								</div>
							</div>
							<div class="form-line">
								<label>联系方式：</label>
								<div class="input-box">
									{{obj.contact}}
								</div>
							</div>
							<div class="form-line">
								<label class="form-line-label">财务联系人：</label>
								<div class="input-box">
									{{obj.financial}}
								</div>
							</div>
							<div class="form-line form-line-boxs">
								<label class="form-line-label">财务联系方式：</label>
								<div class="input-box">
									{{obj.financialPhone}}
								</div>
							</div>

						</form>
						<div class="tab-tit">
							<a href="javascript:;" @click="clickcurId(0)" :class="{'cur':curId===0}">文本</a>
							<a href="javascript:;" @click="clickcurId(1)" :class="{'cur':curId===1}">图像</a>
							<a href="javascript:;" @click="clickcurId(2)" :class="{'cur':curId===2}">音视频</a>

							<!--     <div v-show="curId == 0">
                <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">上传附件</a>
                <input type="file" multiple id="imageAttachment" accept=".doc,.docx,.xls,.xlsx,.pdf,.html,.txt"
                       @change="idFrontImg($event)" style="display: none;" />
              </div>

              <div v-show="curId == 1">
                <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchImg(1)">上传附件</a>
                <input type="file" multiple id="touchImg" accept="image/*"
                       @change="touchUploadImg($event)" style="display: none;" />
              </div>

              <div v-show="curId == 2">
                <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchVideo(1)">上传附件</a>
                <input type="file" multiple id="touchVideo" accept="video/*"
                       @change="idFrontVideo($event)" style="display: none;" />
              </div>-->
						</div>
						<!--表头-->

						<div class="tab-con">
							<div v-show="curId===0">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
									</tr>
									<tr v-for="f in FileUpload">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
							<div v-show="curId===1">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
									</tr>
									<tr v-for="f in FileUploadImg">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
							<div v-show="curId===2">
								<table>
									<tr>
										<th>文本名称</th>
										<th>在线预览</th>
										<th>下载</th>
									</tr>
									<tr v-for="f in FileUploadVideo">
										<td>{{f.name}}</td>
										<td>
											<input type="button" @click="toSrc(f.url)" value="查看" class="delete write" />
										</td>
										<td>
											<input type="button" value="下载" @click="downloadResources(f.url)" class="delete write" />
										</td>

									</tr>
								</table>
							</div>
						</div>
						<!--数据-->

					</div>
				</div>
			</div>
		</div>

	</div>

</template>
<script src="./EnterpriseLibrary.js"></script>

<style scoped>
	@import "EnterpriseLibrary.css";
</style>
